home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / Internet / TurboTCP 2.1 ƒ / TurboTCP core / UTurboTCP.h < prev   
Encoding:
Text File  |  1995-01-06  |  1.6 KB  |  65 lines  |  [TEXT/MMCC]

  1. //
  2. // UTurboTCP.h
  3. //
  4. //    TurboTCP library
  5. //    Utility functions
  6. //
  7. //    Copyright © 1993-95, FrostByte Design / Eric Scouten
  8. //
  9.  
  10. #pragma once
  11.  
  12.  
  13. //***********************************************************
  14. //
  15. // Miscellaneous public constants
  16. //
  17.  
  18. enum {
  19.     minReceiveSize = 4096,                // minimum TCP receive buffer
  20.     recReceiveSize = 16384,                // recommended TCP buffer size
  21.     recAutoRecNum     = 4,                    // recommended # of auto-receive calls (set higher for high performance)
  22.     recAutoRecSize     = 4                    // recommended size of RDS for auto-receive (set higher for high performance)
  23. };
  24.  
  25.  
  26. //***********************************************************
  27. //
  28. // custom OSErr codes: start from +23000 since MacTCP starts with -23000
  29. //
  30.  
  31. enum {
  32.     noTCPError = 23000,                // MacTCP is not installed
  33.     noResolverErr = 23002,                // MacTCP’s DNR is not available
  34.     resolverInUse = 23003,                // resolver call object was already being used
  35.     resolverBusy = 23004                // MacTCP’s DNR was busy
  36. };
  37.  
  38.  
  39. //***********************************************************
  40.  
  41. class UTurboTCP {
  42.  
  43. // This utility class provides some application-wide services from TurboTCP.
  44. // It is meant to be the standard entry point for those functions that are not part
  45. // of the CTCPEndpoint interface.
  46.  
  47. public:
  48.  
  49.     // opening/closing TCP services
  50.  
  51.     static void            InitTCP();
  52.     static void            CloseTCP();
  53.  
  54.     // processing network events
  55.  
  56.     static void            ProcessNetEvents(short maxEventsToProcess, long maxTicks,
  57.                             Boolean inBackground = false);
  58.  
  59.     // IP address utilities
  60.  
  61.     static unsigned long    GetLocalIPAddr();
  62.     static void            DoAddrToStr(unsigned long theIPaddr, char* theString);
  63.  
  64. };
  65.